package com.medical.manage.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.medical.common.core.domain.Result;
import com.medical.manage.domain.BrowseRecording;
import com.medical.manage.mapper.BrowseMapper;
import com.medical.manage.service.BrowseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @BelongsProject: medical
 * @BelongsPackage: com.medical.manage.service.impl
 * @Author: szw
 * @CreateTime: 2025-03-13  20:07
 * @Description: TODO
 * @Version: 1.0
 */
@Service
public class BrowseServiceImpl extends ServiceImpl<BrowseMapper, BrowseRecording> implements BrowseService {
    @Autowired
    private BrowseMapper browseMapper;

    /**
     * 统计浏览数量
     * @param id
     * @return
     */
    @Override
    public Result countBrowseNum(Integer id) {
       int browseCount = browseMapper.countBrowseNum(id);
       return Result.success(browseCount);
    }

    /**
     * 添加浏览记录
     * @param browseRecording
     */
    @Override
    public void addBrowseRecording(BrowseRecording browseRecording) {
        browseMapper.addBrowseRecording(browseRecording);
    }
}
